public class GxExpression
extends GxExpressionAbstract
Expressions are Javascript functions which are written as strings. When you provide an expression to the grid, the grid converts the expression into a function for you and then executes the function on the client.
Expressions can be used with the columns ValueGetterExpression, ValueFormatterExpression, ValueSetterExpression, ValueParserExpression.
For example you can add a virtual column to the grid and define a value getter expression to get the value of this column based on other two columns.
Expression can be as simple as "data.CDNumber" or more complex as the GxExpressionNumbersFormatter which can accepts parameters.
When working with expression key the following points in mind:
Expression can access several predefined variables :
x | Mapped from cell value |
value | Same as x |
oldValue | Mapped from the cell's old value, this is mapped in editing |
newValue | Mapped from the cell's new value, this is mapped in editing |
data | Mapped from the DataRow |
column | Current column |
columnGroup | Current column group |
getValue | The value after it is processed by the ValueGetterExpression |
ctx | The grid client context |
Modifier and Type | Field and Description |
---|---|
BBjString | Expression! Expression string |
Constructor and Description |
---|
GxExpression(BBjString expression!) |
Modifier and Type | Method and Description |
---|---|
String | toString() |